package com.ysd.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ysd.entity.Books;
import com.ysd.service.CategoryBooksService;
import com.ysd.util.Result;

@Controller
public class CategoryBooksController  {

	
	@Autowired
	private CategoryBooksService cbService;
	
	@RequestMapping("getCategoryBooks")
	@ResponseBody
	public List<Books> getCategoryBooks(Books categoryId) {
	List<Books> 	list=cbService.getCategory(categoryId);
	
	if(list!=null) {
		 Result.toClient("0", "查询成功", null, list);
	} else {
		 Result.toClient("1", "查询失败", null, null);
	}
		
		return list;
	}
}
